package com.firewolf.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import com.firewolf.springcloud.rules.MyRule;
import com.netflix.loadbalancer.IRule;
@Configuration
public class MyConfig {
	@Bean
	@LoadBalanced //添加了负载均衡
	RestTemplate restTemplate() {
		return new RestTemplate();
	}
	
	@Bean
	IRule myRule(){
		return new MyRule();
	}
//	@Bean
//	IRule loadBalanceRule(){
//		return new RandomRule();
//	}
}
